import 'package:cbec_app/generated/json/base/json_convert_content.dart';
import 'package:cbec_app/pages/goods/entity/invited_friends_entity.dart';

InvitedFriendsEntity $InvitedFriendsEntityFromJson(Map<String, dynamic> json) {
  final InvitedFriendsEntity invitedFriendsEntity = InvitedFriendsEntity();
  final String? bookId = jsonConvert.convert<String>(json['bookId']);
  if (bookId != null) {
    invitedFriendsEntity.bookId = bookId;
  }
  final String? activityId = jsonConvert.convert<String>(json['activityId']);
  if (activityId != null) {
    invitedFriendsEntity.activityId = activityId;
  }
  final int? bookStatus = jsonConvert.convert<int>(json['bookStatus']);
  if (bookStatus != null) {
    invitedFriendsEntity.bookStatus = bookStatus;
  }
  final int? people = jsonConvert.convert<int>(json['people']);
  if (people != null) {
    invitedFriendsEntity.people = people;
  }
  final int? newPeople = jsonConvert.convert<int>(json['newPeople']);
  if (newPeople != null) {
    invitedFriendsEntity.newPeople = newPeople;
  }
  final int? needPeople = jsonConvert.convert<int>(json['needPeople']);
  if (needPeople != null) {
    invitedFriendsEntity.needPeople = needPeople;
  }
  final String? ld = jsonConvert.convert<String>(json['ld']);
  if (ld != null) {
    invitedFriendsEntity.ld = ld;
  }
  final int? ldTimeStamp = jsonConvert.convert<int>(json['ldTimeStamp']);
  if (ldTimeStamp != null) {
    invitedFriendsEntity.ldTimeStamp = ldTimeStamp;
  }
  final int? commodityType = jsonConvert.convert<int>(json['commodityType']);
  if (commodityType != null) {
    invitedFriendsEntity.commodityType = commodityType;
  }
  final String? spuSpecBody = jsonConvert.convert<String>(json['spuSpecBody']);
  if (spuSpecBody != null) {
    invitedFriendsEntity.spuSpecBody = spuSpecBody;
  }
  final String? goodsName = jsonConvert.convert<String>(json['goodsName']);
  if (goodsName != null) {
    invitedFriendsEntity.goodsName = goodsName;
  }
  final String? goodsId = jsonConvert.convert<String>(json['goodsId']);
  if (goodsId != null) {
    invitedFriendsEntity.goodsId = goodsId;
  }
  final int? specNum = jsonConvert.convert<int>(json['specNum']);
  if (specNum != null) {
    invitedFriendsEntity.specNum = specNum;
  }
  final String? img = jsonConvert.convert<String>(json['img']);
  if (img != null) {
    invitedFriendsEntity.img = img;
  }
  final double? price = jsonConvert.convert<double>(json['price']);
  if (price != null) {
    invitedFriendsEntity.price = price;
  }
  final double? priceBook = jsonConvert.convert<double>(json['priceBook']);
  if (priceBook != null) {
    invitedFriendsEntity.priceBook = priceBook;
  }
  final String? avatar = jsonConvert.convert<String>(json['avatar']);
  if (avatar != null) {
    invitedFriendsEntity.avatar = avatar;
  }
  final List<dynamic>? imgs = (json['imgs'] as List<dynamic>?)?.map((e) => e).toList();
  if (imgs != null) {
    invitedFriendsEntity.imgs = imgs;
  }
  final String? orderId = jsonConvert.convert<String>(json['orderId']);
  if (orderId != null) {
    invitedFriendsEntity.orderId = orderId;
  }
  return invitedFriendsEntity;
}

Map<String, dynamic> $InvitedFriendsEntityToJson(InvitedFriendsEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['bookId'] = entity.bookId;
  data['activityId'] = entity.activityId;
  data['bookStatus'] = entity.bookStatus;
  data['people'] = entity.people;
  data['newPeople'] = entity.newPeople;
  data['needPeople'] = entity.needPeople;
  data['ld'] = entity.ld;
  data['ldTimeStamp'] = entity.ldTimeStamp;
  data['commodityType'] = entity.commodityType;
  data['spuSpecBody'] = entity.spuSpecBody;
  data['goodsName'] = entity.goodsName;
  data['goodsId'] = entity.goodsId;
  data['specNum'] = entity.specNum;
  data['img'] = entity.img;
  data['price'] = entity.price;
  data['priceBook'] = entity.priceBook;
  data['avatar'] = entity.avatar;
  data['imgs'] = entity.imgs;
  data['orderId'] = entity.orderId;
  return data;
}

extension InvitedFriendsEntityExtension on InvitedFriendsEntity {
  InvitedFriendsEntity copyWith({
    String? bookId,
    String? activityId,
    int? bookStatus,
    int? people,
    int? newPeople,
    int? needPeople,
    String? ld,
    int? ldTimeStamp,
    int? commodityType,
    String? spuSpecBody,
    String? goodsName,
    String? goodsId,
    int? specNum,
    String? img,
    double? price,
    double? priceBook,
    String? avatar,
    List<dynamic>? imgs,
    String? orderId,
  }) {
    return InvitedFriendsEntity()
      ..bookId = bookId ?? this.bookId
      ..activityId = activityId ?? this.activityId
      ..bookStatus = bookStatus ?? this.bookStatus
      ..people = people ?? this.people
      ..newPeople = newPeople ?? this.newPeople
      ..needPeople = needPeople ?? this.needPeople
      ..ld = ld ?? this.ld
      ..ldTimeStamp = ldTimeStamp ?? this.ldTimeStamp
      ..commodityType = commodityType ?? this.commodityType
      ..spuSpecBody = spuSpecBody ?? this.spuSpecBody
      ..goodsName = goodsName ?? this.goodsName
      ..goodsId = goodsId ?? this.goodsId
      ..specNum = specNum ?? this.specNum
      ..img = img ?? this.img
      ..price = price ?? this.price
      ..priceBook = priceBook ?? this.priceBook
      ..avatar = avatar ?? this.avatar
      ..imgs = imgs ?? this.imgs
      ..orderId = orderId ?? this.orderId;
  }
}
